<?php

namespace App\Listeners;

use App\Events\EventAutoOrderCancel;
use App\Services\Orders\OrderService;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class EventListenerAutoOrderCancel
{
    protected $OrderService;
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(OrderService $orderService)
    {
        $this->OrderService=$orderService;
    }

    /**
     * Handle the event.
     *
     * @param  EventAutoOrderCancel  $event
     * @return void
     */
    public function handle(EventAutoOrderCancel $event)
    {
        $order_info=$event->orderinfo;
        $this->OrderService->auto_order_cancel($order_info);
    }
}
